<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>hello spring boot</title>
</head>
<body>
    <form action="hello/demoAdd" method="post" th:object="${demo}">
       <p>姓名：<input type="text" name="name" th:value="*{name}" />
       </p>
       <p th:if="${#fields.hasErrors('name')}" th:errors="*{name}">Name Error</p>
       <p>密码：<input type="text" name="password" th:value="*{password}"  />
       </p>
       <p th:if="${#fields.hasErrors('password')}" th:errors="*{password}">password Error</p>
       <p><button>提交</button></p>
    </form>
</body>
</html>